<?php

namespace app\mall\ui\form;

/**
 * 商品评论表单
 */
class MallGoodsCommentForm
{
    public function uid()
    {
        return [
            'type' => 'number',
            'title' => '用户',
            'field' => 'uid',
            'validate' =>
                [
                    [
                        'required' => true,
                        'message' => '不能为空',
                    ],
                ],
        ];
    }

    public function goods_id()
    {
        return [
            'type' => 'number',
            'title' => '商品',
            'field' => 'goods_id',
        ];
    }

    public function store_id()
    {
        return [
            'type' => 'number',
            'title' => '门店',
            'field' => 'store_id',
        ];
    }

    public function store_goods_id()
    {
        return [
            'type' => 'number',
            'title' => '门店商品',
            'field' => 'store_goods_id',
        ];
    }

    public function create_time()
    {
        return [
            'type' => 'input',
            'title' => '创建时间',
            'field' => 'create_time',
        ];
    }

    public function score()
    {
        return [
            'type' => 'radio',
            'options' =>
                [
                    [
                        'value' => 0,
                        'label' => '请选择',
                    ],
                ],
            'title' => '分数',
            'field' => 'score',
        ];
    }

    public function comment()
    {
        return [
            'type' => 'input',
            'title' => '评论内容',
            'field' => 'comment',
        ];
    }

    public function images()
    {
        return [
            'type' => 'uploadImages',
            'action' => config('thinkAdmin.upload_url'),
            'title' => '评论晒图',
            'field' => 'images',
        ];
    }
}